<template>
  <div>
    <ul>
      <li v-for="index in arr" :key="index">{{index}}</li>
    </ul>
    <button @click="a">走一走</button>




  </div>
</template>

<script>
export default {
  data() {
    return {
      arr:['帅哥','美女','程序员']
    }
  },
  methods: {
    a(){
      let obj = ''
      let newArr = []
      obj = this.arr[0]
      this.arr[0] =this.arr[1]
      this.arr[1] =this.arr[2]
      this.arr[2] =obj
      newArr.push(this.arr[0],this.arr[1],this.arr[2])
      this.arr= newArr
    }
  },
}
</script>

<style>

</style>